Method and related apparatus for searching the syncword of a next frame in an encoded digital signal

ABSTRACT

A method and apparatus for searching the synchronization signal of a next frame in encoded digital signal without the need of referring to a frame length indication signal. The encoded digital signal contains a plurality of frames, wherein each frame may have varying length and contain a synchronization signal. The method includes determining a search region, and locating the synchronization signal in the search region.

BACKGROUND OF INVENTION

The invention relates to a method and apparatus for searching thesynchronization signal of a next frame and thus determining the framelength of the current frame in digital encoded signals. Moreparticularly, the invention relates to a method and apparatus forutilizing a lookup table to determine a search region andbackward-searching the synchronization signal of the next frame in thesearch region.

Various digital video/audio processing standards are widely used in theindustry to encode the video or audio data into digital encoded signalsfor further transmission or storing operations. For instance, MPEG audiostandard (ISO/IEC 11172-3 and ISO/IEC13818-3) is for compressing anddecompressing audio signals with different sampling rates and bit rates.MPEG audio standard defines three layers, which are Layer I, Layer II,and Layer III. The digital encoded signals conforming to MPEG audiostandard includes a plurality of frames; each frame includes a pluralityof fields. FIG. 1 illustrates the format of a frame specified in thethree different layers of the MPEG audio standard. Take MPEG audiolayer-1 for example, each frame includes header, alloc, scalefactors,samples, and ANC fields. Though MPEG audio layer I, II, and III havedifferent formats of frames, they have the same header formats, as shownin FIG. 2.

PEG audio standard defines compressing and decompressing audio signalswith different sampling rates and bit rates. For some specific samplingrate and bit rate, frames with varying lengths are used to achieveaverage bit rate. Since each frame may have different length, the actuallength of each frame has to be obtained when the digital encoded signalis to be decoded. In U.S. Pat. No. 5,777,992, a method used to calculatethe length of a current frame is disclosed, and the following formula isincluded:

${P = {\frac{Br}{N} \times \frac{n_{S}}{F_{S}}}},$where P represents the number of slots included in the current frame; Bris a bit rate of the digital encoded signal; N is the number of bitsincluded in a slot; n_(S) is the number of samples included in a frame;and F_(S) is the sampling rate of the digital encoded signal.

When a decoder of the related art receives a current frame of theabove-mentioned digital encoded signal, the decoder first utilizes theabove-mentioned formula to calculate the length of the current frame andthen perform the following decoding operations toward the current frame.When P calculated by utilizing the formula is an integer, the currentframe includes P slot(s); when the calculated P is not an integer, thecurrent frame possibly includes P′r P′+1 slot(s), wherein P′ is thehighest integer whose value is less than P. To correctly decode thedigital encoded signals with varying frame lengths, the decoder needs anapproach to determine the number of slots (equal to either P′ or P′1)included in the current frame.

In MPEG audio standard, the header includes a padding bit signaling thelength of the frame. If the calculated P by utilizing theabove-mentioned formula is not an integer, the decoder of the relatedart checks the padding bit; if the padding bit is 0, the current frameincludes P′ slots; if the padding bit is 1, the current frame includesP′+1 slots. In other words, the decoder of the related art utilizes theabove-mentioned formula to calculate P and then determine the length ofthe current frame by checking the padding bit.

In the header of each frame in the digital encoded signal, asynchronization signal is included. The synchronization signal generallyowns specific data patterns for easy identification. For digital encodedsignals conforming to the MPEG audio standard, the synchronizationsignal is called ‘syncword’ The data pattern of the syncword is fixed as‘1111 1111 1111’ in the binary system, which is ‘0xFFF’ in thehexadecimal system. The system of the related art can forward-search thefixed data pattern (‘0xFFF’) from the current frame so as to determinethe syncword in a next frame. Afterwards, by calculating the differenceof the positions between the syncword of the current frame and thesyncword of the next frame, the length of the current frame is obtained.

There have been many MPEG audio encoders accumulated in the market, andsome does not encode audio signals in a way strictly conforming to MPEGaudio standard. According to MPEG standard, the specific data pattern isexclusively reserved for the syncword and should not appear in any otherpositions in the frames. However, for some digital encoded signals notstrictly conforming to MPEG audio standard, the specific data patternmay appear in other positions in the frames. For instance, in MPEG audiostandard, ‘0’ should be utilized as a stuffing bit, so the stuffingsequence is ‘0000 . . . ’ However, some encoders utilize ‘1’ as thestuffing bit, so the stuffing sequence is ‘1111 . . . ’ and may beconfused with the syncword (‘1111 1111 1111’). Therefore, theabove-mentioned forward-searching method does not work due to thepossibility that other data (such as the inappropriate stuffing sequence‘1111 . . . ’ may be incorrectly interpreted as the syncword, and thusan incorrect frame length of the current frame is obtained.

SUMMARY OF INVENTION

It is therefore an objective of the invention to provide a method andapparatus for determining the synchronization signal of a next frame inencoded digital signals without referring to the padding bit.

It is also an objective of the invention to provide a method andapparatus for determining the position of the synchronization signal ofa next frame in encoded digital signals without using the formula.

According to the embodiment, a method for searching a synchronizationsignal of a next frame in digital encoded signals is disclosed. Thedigital encoded signals include a plurality of frames, and each frameincludes a synchronization signal. The method includes using a lookuptable to determine a search region for searching the synchronizationsignal of the next frame, and determining the position of thesynchronization signal of the next frame in the search region in thedigital encoded signals.

According to the embodiment, an apparatus for searching asynchronization signal of a next frame in digital encoded signals isdisclosed. The digital encoded signals have a plurality of frames, andeach frame has a synchronization signal. The apparatus includes a bufferfor receiving the digital encoded signals, and a searching modulecoupled to the buffer for determining a search region used to search thesynchronization signal of the next frame according to a lookup table andfor determining the position of the synchronization signal of the nextframe in the search region in the digital encoded signals.

These and other objectives of the present invention will no doubt becomeobvious to those of ordinary skill in the art after reading thefollowing detailed description of the preferred embodiment, which isillustrated in the various figures and drawings.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of the frame formats of three differentlayers conforming to the MPEG audio standard.

FIG. 2 is a schematic diagram of header format conforming to MPEG audiostandard.

FIG. 3 is a flow chart of an embodiment of the method according to thepresent invention.

FIG. 4 is an illustrative lookup table based on experimental statisticsconforming to the MPEG 1 audio layer III standard (MP3).

FIG. 5 is a schematic diagram of an embodiment of an apparatus accordingto the present invention.

DETAILED DESCRIPTION

The method and related apparatus disclosed in the following embodimentsconform to MPEG audio standard. FIG. 3 illustrates a flow chart of anembodiment of the method according to the present invention.

Step 310: Receive a bit-rate index (BRI) and a sampling-rate index (FSI)in a current frame of the digital encoded signals. In MPEG audiostandard, the bit-rate index and the sampling-rate index are included inpredetermined and fixed positions in the header of each frame.

Step 320: Utilize a lookup table to determine a search regioncorresponding to the bit-rate index and the sampling-rate index. FIG. 4illustrates an example of a lookup table acquired by experimentalstatistics conforming to the MPEG 1 audio layer III standard (MP3). Thesearch region of the lookup table is represented by the number of slotscounted from the beginning of the current frame. For example, “Startingposition: 106; Ending position: 104” indicates the search region startsfrom the 106^(th) slot counted from the beginning of the current frame,ends at the 104^(th) slot counted from the beginning of the currentframe, and therefore includes the 106^(th) slot, the 105^(th) slot, andthe 104^(th) slot. In this embodiment the lookup table is acquired byexperimental statistics and is appropriate for MPEG 1 audio layer III(MP3). It is noted that in other embodiments the lookup table can bemodified to be applied to different industrial standards. In addition,in this embodiment the lookup table is indexed by the bit-rate index andthe sampling-rate index. It is also noted that the lookup table could beindexed by other information. For instance, in another industrialstandard AAC (advanced audio coding, ISO/IEC 13818-7), the lookup tablecan be indexed by the frame length.

Step 330: In the search region of the digital encoded signals, utilize abackward-searching way to determine the syncword of the next frame. Asmentioned above, some digital encoded signals may have ‘1’ as thestuffing bit. Therefore in this embodiment the searching operation isperformed in a backward-searching manner to avoid incorrectlyidentifying the stuffing sequence as the syncword. When performing thebackward-searching operation in the search region, the first matchedspecific data pattern (for example, ‘1111 1111 1111’ in this embodiment)is determined as the syncword. In the present embodiment, the backwardsearching can avoid the possibility of incorrectly identifying thestuffing sequence as the syncword. In other embodiments if the stuffingsequence will not be confused with the synchronization signal, it isfeasible to search the syncword in the next frame of the search regionby utilizing either the forward searching or the backward searching.

The lookup table shown in FIG. 4 is acquired based on the experimentalstatistics. As for each sampling-rate index and bit-rate index, thelookup table in FIG. 4 provides a search region represented by astarting position and an ending position. The lookup table may alsoindicate a search region represented by a starting position and thenumber of slots to be searched in a forward-searching or a backwardsearching manner. For example, the search region could be defined by‘starting position: 106, Number of slots: 3, Backward Searching’indicating a search range of three slots starting from the 106^(th)slot, which includes the 106^(th) slot, the 105^(th) slot, and the104^(th) slot counted from the beginning of the current frame.

FIG. 5 illustrates a schematic diagram of an embodiment of an apparatusaccording to the present invention. The apparatus 500 includes a firstbuffer 510 and a syncword-searching module 520. The syncword-searchingmodule 520, which is coupled to the first buffer 510, includes a headerdetector 530 for receiving the bit-rate index and the sampling-rateindex in a current frame of the digital encoded signal. A read-onlymemory 550 for storing a lookup table, and the syncword-searching module520 can determine a search region corresponding to the bit-rate indexand the sampling-rate index in the lookup table. A searching device 570is used for backward-searching a specific data pattern to determine thesyncword of a next frame in the search region of the digital encodedsignal. In order to prevent the searching device 570 from incorrectlyidentifying the stuffing sequence as the syncword, the searching device570 set the first-matched specific data pattern as the correct syncwordduring the backward-searching process. In other embodiments if thestuffing sequence will not be confused with the syncword, it is feasibleto search the syncword in the next frame of the search region in eitherthe forward searching or the backward searching manner.

In the present embodiment, the apparatus 500 is installed in a decoder600, and the decoder 600 includes a second buffer 610, a multiplexer620, and a decoding module 630 in addition to the apparatus 500. Thesecond buffer 610 and the multiplexer 620 are mainly used to processencoded MPEG audio Layer III signals. The header detector 530 cancontrol the multiplexer 620 according to the detected format of thedigital encoded signal. For instance, when the header detector 530detect that the digital encoded signal conforms to the MPEG 1 AudioLayer III standard, the digital encoded signal can be transmitted to thedecoding module 630 via the first buffer 510, the second buffer 610, andthe multiplexer 620. The decoding module 630 can be used to parse thesignals, reconstruct, and inverse map related data. When the digitalencoded signal is an audio signal, the outputted reconstruct signal canbe a pulse-code-modulation (PCM) audio signal.

It is obvious that the method and apparatus of the present invention arenot constrained to be applied only to the MPEG audio standard; themethod and apparatus of the present invention can be applied to otherdigital encoded signals consisting of frames of varying lengths, whereineach frame includes the syncword of a specific data pattern.

In contrast to the related art, the method and apparatus according tothe present invention looks up a table to determine the possibleposition of the synchronization signal of the next frame instead ofutilizing a formula-related calculation and the padding bit, utilizes abackward-searching way to determine the synchronization signal of thenext frame according to the predetermined data pattern of thesynchronization signal, and then compares the spatial difference betweenthe synchronization signal of the next frame and the synchronizationsignal of the current frame to obtain the length of the current framefor further decoding operation.

Those skilled in the art will readily observe that numerousmodifications and alterations of the device and method may be made whileretaining the teachings of the invention. Accordingly, the abovedisclosure should be construed as limited only by the metes and boundsof the appended claims.

1. A method for locating a synchronization signal of a next frame in adigital encoded signal, the digital encoded signal comprising aplurality of frames, each frame comprising the synchronization signal,the method comprising: (a0) providing a lookup table defining aplurality of predetermined search regions; (a) determining a searchregion from the predetermined search regions of the lookup tableaccording to the digital encoded signal; and (b) locating thesynchronization signal of the next frame in the search region in thedigital encoded signal.
 2. The method of claim 1 wherein the step (a0)further comprises: (c) receiving a bit-rate signal and a sampling-ratesignal in a current frame of the digital encoded signal; wherein in step(a), the lookup table is utilized to determine the search regionaccording to the received bit-rate signal and the sampling-rate signal.3. The method of claim 2 wherein the lookup table is stored withspecific search regions, each of which corresponds to each set of thebit-rate signal and the sampling-rate signal.
 4. The method of claim 2wherein each search region stored in the lookup table comprises astarting position and an ending position.
 5. The method of claim 1wherein in step (b), locating the synchronization signal of the nextframe comprises backward-searching a predetermined data pattern in thesearch region.
 6. The method of claim 1 wherein in step (b), locatingthe synchronization signal of the next frame comprises forward-searchinga predetermined data pattern in the search region.
 7. The method ofclaim 1 wherein in step (b), locating the synchronization signal of thenext frame comprises backward-searching the predetermined data patternmatched for a first time in the search region.
 8. The method of claim 1wherein the digital encoded signal is generated according to MPEG audiostandard.
 9. An apparatus for searching a synchronization signal of anext frame in a digital encoded signal, the digital encoded signalcomprising a plurality of frames, each frame comprising thesynchronization signal, the apparatus comprising: an input for receivingthe digital encoded signal; and a searching module coupled to the inputfor determining a search region used to search the synchronizationsignal of the next frame according to the digital encoded signal and alookup table having a plurality of predetermined search regions and fordetermining, in the search region, the position of the synchronizationsignal of the next frame.
 10. The apparatus of claim 9 wherein thesearching module is capable of receiving a bit-rate signal and asampling-rate signal in a current frame of the digital encoded signaland utilizing the lookup table to determine the search regioncorresponding to the bit-rate signal and the sampling-rate signal. 11.The apparatus of claim 10 wherein the searching module comprises amemory unit for storing the lookup table.
 12. The apparatus of claim 11wherein the memory unit is a read-only memory.
 13. The apparatus ofclaim 11 wherein the searching module further comprises: a headerdetector coupled to the input for receiving the bit-rate signal and thesampling-rate signal in the current frame; and a searching devicecoupled to the header detector and the memory unit for determining theposition of the synchronization signal of the next frame in the searchregion in the digital encoded signal.
 14. The apparatus of claim 9wherein the searching module backward-searches a predetermined datapattern in the search region of the digital encoded signal to determinethe position of the synchronization signal of the next frame.
 15. Theapparatus of claim 9 wherein the searching module forward-searches apredetermined data pattern in the search region of the digital encodedsignal to determine the position of the synchronization signal of thenext frame.
 16. The apparatus of claim 9 wherein the searching modulebackward-searches the predetermined data pattern matched for a firsttime in the search region of the digital encoded signal to determine theposition of the synchronization signal of the next frame.
 17. Theapparatus of claim 9 wherein the digital encoded signal is generatedaccording to MPEG audio standard.
 18. A method for decoding a digitalencoded signal having frames each comprising a header, the headerincludes a synchronization signal, an index signal, and a frame-lengthindication signal, the frame-length indication signal indicates whethera current frame has a first length or a second length different from thefirst length, the method comprising the steps of: (a0) providing alookup table defining a plurality of predetermined search regions; (a)receiving the bit-rate signal and the sampling-rate signal; (b)determining a search range from the predetermined search regions of thelookup table according to the bit-rate signal and the sampling-ratesignal; and (c) locating the synchronization signal of a next frame bybackward-searching a predetermined data pattern in the search region.19. The method of claim 18, wherein the index signal includes a bit-ratesignal and a sampling-rate signal.
 20. The method of claim 18, whereinstep (b) further comprises referring to the lookup table for determiningthe search range according to the index signal.
 21. The method of claim18, further comprising: (d) comparing a position of the synchronizationsignal of the next frame with a position of the synchronization signalof the current frame to determine whether the current frame has thefirst length or the second length without the need of referring to theframe-length indication signal.
 22. The method of claim 18, wherein theframe-length indication signal includes a padding bit defined in MPEGaudio standard.
 23. A method for determining a frame length of a currentframe in the process of decoding digital encoded signal, the digitalencoded signal include frames each comprising a header, the headerincludes a synchronization signal, an index signal, and a frame-lengthindication signal, the frame-length indication signal indicates whethera current frame has a first length or a second length different from thefirst length, the method comprising: (a0) providing a lookup tabledefining a plurality of predetermined search regions; (a) receiving theindex signal; (b) determining a search range from the predeterminedsearch regions of the lookup table according to the index signal byreferring to the lookup table; (c) locating the synchronization signalof a next frame by searching a predetermined data pattern in the searchregion; and (d) comparing a position of the synchronization signal ofthe next frame with a position of the synchronization signal of thecurrent frame to determine whether the current frame has the firstlength or the second length without the need of referring to theframe-length indication signal.
 24. The method of claim 23, wherein thestep (c) further comprises locating the synchronization signal of a nextframe by backward-searching the predetermined data pattern in the searchregion.
 25. The method of claim 23, wherein the index signal comprises abit-rate signal and a sampling-rate signal.
 26. The method of claim 25,wherein the lookup table uses the bit-rate signal and the sampling-ratesignal as indices for providing the search range.
 27. The method ofclaim 1 wherein the search region having a plurality of slots and alength shorter than a frame length.
 28. The method of claim 1 whereinthe lookup table is not obtained from the digital encoded signal.